vcPointSet
Used for creating and rendering point clouds and/or data points.
See in: Overview
Module: vcGeometry
Parent: vcGeometrySet
Children -
Referenced by: -
Properties
Learn how to use properties here. The properties are also inherited from the parent class.
| Name | Type | Access | Description |
| ColorConfiguration | vcPointSetColorConfiguration | RW | Gets or sets the color format for points. By default, the color format is RGBA. |
| IncrementalBoundUpdate | Boolean | RW | Gets or sets if the bounding box should be updated on every added point or not. |
| PointCount | Integer | R | Gets the number of points in the point set. |
| PointSize | Real | RW | Gets or sets the size (in pixels) of points in set. |
| Scale | Real | RW | Gets or sets a factor for scaling the point coordinates. In other words, this scales the volume of the point set. |
Methods
Learn how to use methods here. The methods are also inherited from the parent class.
| Name | Return Type | Parameters | Description |
| addPoint | Integer | Real x, Real y, Real z | Adds a point to the set. The point coordinates are in World coordinate system. The point is assigned default color.See moreParameters: x (float): X coordinate of the point. y (float): Y coordinate of the point. z (float): Z coordinate of the point. Returns: int: The index of the new point in the set. |
| addPoint | Integer | vcVector point | Adds a point to the set. The point coordinates are in World coordinate system. The point is assigned default color.See moreParameters: position (vcVector): The coordinates of the point. Returns: int: The index of the new point in the set. |
| addPoint | Integer | Real x, Real y, Real z, Real r, Real g, Real b, Optional Keyword[a = Real] | Adds a point to the set with the given color. The point coordinates are in World coordinate system.See moreParameters: x (float): X coordinate of the point. y (float): Y coordinate of the point. z (float): Z coordinate of the point. r (float): Red component of the color. g (float): Green component of the color. b (float): Blue component of the color. a (float): Alpha component of the color. Returns: int: The index of the new point in the set. |
| addPoint | Integer | vcVector point, vcColor color | Adds a point to the set with the given color. The point coordinates are in World coordinate system.See moreParameters: position (vcVector): The coordinates of the point. color (vcColor): The color. Returns: int: The index of the new point in the set. |
| clearPoints | None | None | Removes all points from the point set. |
| getPointColor | vcColor | Integer pointIndex | Get the color of the point with the given an index.See moreParameters: pointIndex (int): The index of the point. Exceptions: IndexError: When the index is out of range. Returns: vcColor: The point color. |
| getPointPosition | vcVector | Integer pointIndex | Get the position of the point with the given an index.See moreParameters: pointIndex (int): The index of the point. Exceptions: IndexError: When the index is out of range. Returns: vcVector: The position of the point. |
| setPointColor | None | Integer pointIndex, Real r, Real g, Real b, Optional Keyword[a = Real] | Sets the RGB components of the color of the point at the given index. Leaves the A (alpha) component unchanged. See moreParameters: pointIndex (int): The index of the point. r (float): Red component of the color. g (float): Green component of the color. b (float): Blue component of the color. Exceptions: IndexError: When the index is out of range. |
| setPointColor | None | Integer pointIndex, vcColor color | Set the RGBA components of the color of the point at the given index.See moreParameters: pointIndex (int): The index of the point. color (vcColor): The color. Exceptions: IndexError: When the index is out of range. |
| setPointPosition | None | Integer pointIndex, Real x, Real y, Real z | Set the point position at the given index.See moreParameters: pointIndex (int): The index of the point. x (float): X coordinate of the point. y (float): Y coordinate of the point. z (float): Z coordinate of the point. Exceptions: IndexError: When the index is out of range. |
| setPointPosition | None | Integer pointIndex, vcVector position | Set the point position at the given index.See moreParameters: pointIndex (int): The index of the point. position (vcVector): The coordinates of the point. Exceptions: IndexError: When the index is out of range. |
| update | None | None | Updates the bounding box of the point set. |
Example: Render Point Cloud
"""Create point cloud with random data""" import vcCore as vc import vcFeatures as vc_fea import vcGeometry as vc_geo import random app = vc.getApplication() comp = vc.getComponent() cloud_size = 1000.0 point_count = 100000 cloud_feat = comp.findFeature('PointCloud') if not cloud_feat: cloud_feat = comp.RootFeature.create(vc_fea.vcFeatureType.GEOMETRY, 'PointCloud') if cloud_feat.Geometry.GeometrySetCount == 0: cloud_set = cloud_feat.Geometry.createGeometrySet(vc_geo.vcGeometrySetType.POINT_SET) else: cloud_set = cloud_feat.Geometry.getGeometrySet(0) cloud_set.clearPoints() for i in range(point_count): x = cloud_size * random.random() y = cloud_size * random.random() z = cloud_size * random.random() r = random.random() g = random.random() b = random.random() cloud_set.addPoint(x, y, z, r, g, b) cloud_set.update() comp.rebuild() app.render()